package com.markyao.controller;

import com.markyao.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

@RestController
public class TestController {
    @Autowired
    @Qualifier("connectSet")
    Map<String, Set<String>> connectSet;
    @Autowired
    @Qualifier("providersMap")
    Map<String,Map<String,String>>providersMap;
    @Autowired
    @Qualifier("refrenceRegistrySet")
    Map<String,Set<String>>refrenceRegistrySet;
    @Autowired
    @Qualifier("serverRegistryMap")
    Map<String,Map<String,String>>serverRegistryMap;
    @Autowired
    @Qualifier("serviceRegistryMap")
    Map<String,Map<String,String>>serviceRegistryMap;
    @Autowired
    @Qualifier("urlMap")
    Map<String,String>urlMap;
    @Autowired
    @Qualifier("heartBeatMap")
    Map<String,Long>heartBeatMap;
    @Autowired
    @Qualifier("errorUrlMap")
    Map<String,String>errorUrlMap;
    @Autowired
    @Qualifier("serverKeySet")
    Set<String>serverKeySet;
    @Autowired
    @Qualifier("killConnectKeys")
    Map<String,Set<String>>killConnectKeys;
    @Autowired
    @Qualifier("reconnectKeys")
    Map<String,Set<String>>reconnectKeys;

    @GetMapping("getAllMap")
    public Result getAllMap(){
        Map<String,Object>allMap=new HashMap<>();
        allMap.put("connectSet",connectSet);
        allMap.put("providersMap",providersMap);
        allMap.put("refrenceRegistrySet",refrenceRegistrySet);
        allMap.put("serverRegistryMap",serverRegistryMap);
        allMap.put("serviceRegistryMap",serviceRegistryMap);
        allMap.put("urlMap",urlMap);
        allMap.put("heartBeatMap",heartBeatMap);
        allMap.put("errorUrlMap",errorUrlMap);
        allMap.put("serverKeySet",serverKeySet);
        return Result.success(allMap);
    }
}
